<template>
  <div class="home">
    <van-search
      v-model="value"
      shape="round"
      disabled
      @click="$router.push('/home/search')"
      placeholder="请输入搜索关键词"
    />
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in banner" :key="item.id">
        <img :src="item.image_url" alt="" />
      </van-swipe-item>
    </van-swipe>
    <van-grid :column-num="5">
      <van-grid-item v-for="v in channel" :key="v.id" :icon="v.icon_url" :text="v.name" />
    </van-grid>
    <transition name="van-slide-right">
      <router-view></router-view>
    </transition>
     <!-- <van-popup v-model="show" position="right" :style="{ height: '100%' }" /> -->
    <div class="brand">
      <div class="brand_top">
          品牌制造商直供
      </div>
    </div>
  </div>
</template>

<script>
// @ is an alias to /src
import { GetHomeLists } from "@/request/api";

export default {
  name: "Home",
  data() {
    return {
      value: "",
      banner: [],
      channel:[]
    };
  },
  components: {},
  created() {
    GetHomeLists().then((res) => {
      console.log(res);
      this.banner = res.banner;
      this.channel=res.channel;
    });
  },

};
</script>
<style lang="less">
img {
  display: block;
  width: 100%;
  height: 100%;
}

</style>
